package com.changli01.string.exer3;

import org.junit.Test;

public class reverseTest {
    public String reverse(String str) {
        String result = "";

        for(int i = str.length() - 1; i >= 0; i--) {
            result += str.charAt(i);
        }


        return result;
    }
    @Test
    public void test() {
        String s1 = "abcd";
        System.out.println(reverse(s1));
    }
}
